fix markup generation#78
Merged
ThomasWaldmann merged 1 commit intodiscorporate:masterfrom Jan 24, 2026
Merged
Conversation
910a03d to
7bcb2eb
Compare
7bcb2eb to
027cf88
Compare
problem:
before this fix, gen.tag('br') did output '<br></br>', which is invalid and should be either '<br />' for xhtml or '<br>' for html5.
this was the case for most void elements.
the old code could easily lead to invalid markup, if the dangle and paired (empty_in_html and always_paired) arguments were not given correctly and the defaults happened to be wrong for the specific element.
fix:
use a set of known html5 void elements (it is reasonable to use the same list also for xhtml generation, the alternative would be worse).
if an element is not in that set, it is a container element.
API: we now reject to call Tag.open or Tag.close methods for void elements, these should be created by gen.tagname(...), which will either create a self-closing tag for xhtml or a dangling tag for html5.
027cf88 to
a3ba989
Compare
This was referenced Jan 23, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.